package com.maxlen.goods.entity.dto;

import com.baomidou.mybatisplus.annotation.TableId;
import com.maxlen.goods.entity.SkuImagesEntity;
import com.maxlen.goods.entity.SkuInfoEntity;
import com.maxlen.goods.entity.SpuInfoDescEntity;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class SkuItemDTO {

    /**
     * sku 基本信息
     */
    private SkuInfoEntity info;

    /**
     * sku 图片
     */
    private List<SkuImagesEntity> images;

    /**
     * spu 销售属性
     */
    private List<SkuItemSaleAttrDTO> saleAttr;

    /**
     * spu 介绍
     */
    private SpuInfoDescEntity desc;

    /**
     * 商品重量
     */
    private BigDecimal weight;

    /**
     * spu 规格参数
     */
    private List<SpuItemAttrGroupDTO> groupVo;

    /**
     * 分类信息
     */
    private List<CategoryDetailDTO> category;

    /**
     * 品牌信息
     */
    private List<BrandDetailDTO> brand;

    /**
     * 是否有库存
     */
    private Boolean haveStock;

    @Data
    public static class SkuItemSaleAttrDTO{
        private Long attrId;
        private String attrName;
        private List<SkuSaleAttrDTO> skuSaleAttrDTOs;
    }

    @Data
    public static class SkuSaleAttrDTO{
        private String attrValue;
        private String skuId;
    }

    @Data
    public static class SpuItemAttrGroupDTO{
        private String  groupName;
        private List<SpuBaseAttrDTO> attrValues;
    }

    @Data
    public static class SpuBaseAttrDTO{
        private String attrName;
        private String attrValue;
    }

    @Data
    public static class CategoryDetailDTO{
        /**
         * 分类id
         */
        private Long catId;
        /**
         * 分类名称
         */
        private String name;
    }

    @Data
    public static class BrandDetailDTO{
        /**
         * 品牌id
         */
        private Long brandId;

        /**
         * 品牌名
         */
        private String name;
    }

}
